<template>
	<view class="page">
		<view class="userInfo">
			<image :src="defaultAvatar" mode="" class="avatar"></image>
			<view class="nikename">昵称</view>
			<view class="phone">(12863682364326)</view>
		</view>
		<view v-if="true" class="binding">
			<view class="binding_title">
				申请绑定孩子账号
			</view>
			<view class="binding_info">
				<view class="title">亲子关系</view>
				<view class="relation">
					<view class="relation_item">
						<image :src="defaultAvatar" mode="" class="avatar"></image>
						<text class="name">孩子账号</text>
					</view>
					<view class="relation_link">
						<text v-for="i in 3" :key="i" class="dot"></text>
					</view>
					<view class="relation_item">
						<image :src="defaultAvatar" mode="" class="avatar"></image>
						<text class="name">爷爷</text>
					</view>
				</view>
			</view>
		</view>
		<view v-else class="binding">
			<view class="binding_title">
				申请绑定设备
			</view>
			<view class="binding_info">
				<view class="title">设备信息</view>
				<view class="equipment">
					序列号：
					<text class="equipment_serial">
						16234992571504193
					</text>
				</view>
			</view>
		</view>
		<view class="btn">
			<button class="single btn_save">同意</button>
			<button class="single btn_quit">拒绝</button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const OSS_URL = import.meta.env.VITE_OSS_HOST;
	const defaultAvatar = `${OSS_URL}/urm/default_avatar.png`
	const list = ref([{
		name: '昵称',
		phone: '17865687879',
	}])
</script>

<style lang="scss" scoped>
	.page {
		padding: 30rpx;

		.userInfo {
			margin-top: 20rpx;
			text-align: center;

			.avatar {
				width: 120rpx;
				height: 120rpx;
			}

			.nikename {
				margin: 20rpx 0 10rpx 0;
				font-size: 30rpx;
				line-height: 32rpx;
				color: rgba(51, 51, 51, 1);
			}

			.phone {
				font-size: 28rpx;
				line-height: 32rpx;
				color: rgba(169, 170, 181, 1);
			}
		}

		.binding {
			margin: 30rpx 0 100rpx;

			&_title {
				text-align: center;
				color: rgba(51, 51, 51, 1);
				font-weight: 500;
				font-size: 32rpx;
				line-height: 32rpx;
			}

			&_info {
				margin-top: 50rpx;
				padding: 30rpx;
				background-color: #fff;
				border-radius: 20rpx;

				.title {
					margin-bottom: 30rpx;
					text-align: center;
					color: rgba(51, 51, 51, 1);
					font-weight: 500;
					font-size: 30rpx;
					line-height: 45rpx;
				}

				.equipment {
					color: rgba(134, 134, 134, 1);
					font-size: 28rpx;
					line-height: 60rpx;

					&_serial {
						color: rgba(51, 51, 51, 1);
					}
				}

				.relation {
					display: flex;
					justify-content: space-between;
					border: 1px solid red;

					&_item {
						.avatar {
							width: 100rpx;
							height: 100rpx;
						}

						.name {
							margin-top: 20rpx;
							display: block;
							font-size: 30rpx;
							line-height: 32rpx;
							color: rgba(102, 102, 102, 1);
						}
					}

					&_link {
					
						.dot {
							display: inline-block;
							width: 8rpx;
							height: 8rpx;
							margin-right: 8rpx;
							background-color: rgba(217, 225, 242, 1);

							&:last-child {
								margin-right: 0;
							}
						}
					}
				}
			}
		}

		.btn {
			.single {
				margin: 0 0 40rpx 0;
				height: 90rpx;
				line-height: 90rpx;
				font-size: 30rpx;
				border-radius: 20rpx;

				&::after {
					border: none;
				}
			}

			&_save {
				background-color: rgba(97, 93, 255, 1);
				color: #fff;
			}

			&_quit {
				background-color: rgba(239, 239, 255, 1);
				color: rgba(97, 93, 255, 1);
			}
		}
	}
</style>